package com.ep.modules.app.controller;

import com.ep.common.annotation.SysLog;
import com.ep.common.utils.PageUtils;
import com.ep.common.utils.R;
import com.ep.common.validator.ValidatorUtils;
import com.ep.modules.app.entity.AppUserAudit;
import com.ep.modules.app.service.AppUserAuditService;
import java.util.Map;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/user_audit")
public class AppUserAuditController {
    @Autowired
    private AppUserAuditService appUserAuditService;

    @GetMapping("/list")
    public R list(Map<String, Object> params) {
        PageUtils page = appUserAuditService.queryPage(params);
        return R.ok().put("page", page);
    }

    @GetMapping("/info/{id}")
    public R info(@PathVariable Long id) {
        AppUserAudit appuseraudit = appUserAuditService.getById(id);
        return R.ok().put("appuseraudit", appuseraudit);
    }

    @SysLog("保存AppUserAudit")
    @PostMapping("/save")
    public R save(@RequestBody AppUserAudit appuseraudit) {
        ValidatorUtils.validateEntity(appuseraudit);
        appUserAuditService.save(appuseraudit);
        return R.ok();
    }

    @SysLog("修改AppUserAudit")
    @PostMapping("/update")
    public R update(@RequestBody AppUserAudit appuseraudit) {
        ValidatorUtils.validateEntity(appuseraudit);
        appUserAuditService.update(appuseraudit);
        return R.ok();
    }

    @SysLog("删除AppUserAudit")
    @PostMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        appUserAuditService.deleteBatch(ids);
        return R.ok();
    }
}